<?php

//$conn = pg_connect('host=postgresql.alwaysdata.com dbname=mytaxisharing_prova user=mytaxisharing_ospite password=ospite');
$conn = pg_connect('host=127.0.0.1 dbname=postgres user=ospite password=qazxswedc');

if(!$conn) {
    die('Connessione fallita !<br />');
} else {
    echo 'Connessione riuscita !<br />';
    $selectfields = array("id_utente" => "1");

//    $records = pg_select($conn,"utenti",$selectfields);

    $records = pg_query($conn,"select * from users");

       $numrows = pg_numrows($records);
        if ($numrows > 0) {
            $arrayData = array();
            for ($row = 0; $row < $numrows; $row++) {
                $arrayData[] = pg_fetch_array($records, $row, PGSQL_ASSOC);
            }
        }
	print_r($arrayData);
	
	phpinfo();
}

?>